package base.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * \* User: Administrator
 * <p>
 * \* Date: 2020/11/19
 * <p>
 * \* Time: 13:15
 * <p>
 * \* Description:
 * \
 */
public class HandlerImpl implements InvocationHandler {

    private Object target;

    public HandlerImpl(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("被代理对象方法执行前》》》》》》》》");
        Object invoke = method.invoke(target, args);
        System.out.println("被代理对象方法执行后》》》》》》》》");
        return invoke;
    }
}
